Skip to content

Comments

[heos] Fix login failure when password contains special characters#19438

Merged
lsiepel merged 1 commit intoopenhab:mainfrom
jlaur:13445-heos-invalid-credentials
Oct 11, 2025
Merged

[heos] Fix login failure when password contains special characters#19438
lsiepel merged 1 commit intoopenhab:mainfrom
jlaur:13445-heos-invalid-credentials

Conversation

@jlaur
Copy link
Contributor

@jlaur jlaur commented Oct 5, 2025

According to the HEOS CLI Protocol Specification only three special characters need to be encoded:

Note: Special characters, i.e '&', '=', and '%' in attribute/value needs to be encoded to '%26(&)', '%3D(=)', and '%25(%)'.

Encoding others will result in status ONLINE (CONFIGURATION_ERROR) with description #6: Invalid Credentials.

Resolves #13445

@jlaur jlaur requested a review from Wire82 as a code owner October 5, 2025 15:15
@jlaur jlaur added the bug An unexpected problem or unintended behavior of an add-on label Oct 5, 2025
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/6-invalid-credentials-when-using-the-heos-binding-2-5-5/103029/11

@jlaur jlaur force-pushed the 13445-heos-invalid-credentials branch from 9adf21d to c65e16b Compare October 5, 2025 15:19
@jlaur jlaur changed the title [heos] Fix login with special characters in password [heos] Fix login failure when password contains special characters Oct 5, 2025
@jlaur jlaur force-pushed the 13445-heos-invalid-credentials branch from c65e16b to 7b6a213 Compare October 5, 2025 18:26
@jlaur jlaur marked this pull request as draft October 5, 2025 18:28
@jlaur jlaur force-pushed the 13445-heos-invalid-credentials branch from 7b6a213 to 3a105f5 Compare October 5, 2025 18:48
@jlaur jlaur marked this pull request as ready for review October 5, 2025 18:48
@jlaur jlaur force-pushed the 13445-heos-invalid-credentials branch from 3a105f5 to 855fbe2 Compare October 6, 2025 18:14
@lsiepel lsiepel requested a review from Copilot October 11, 2025 11:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a login failure issue in the HEOS binding when passwords contain special characters. The previous implementation incorrectly used full URL encoding, which caused authentication errors for passwords containing certain special characters.

  • Replaced full URL encoding with selective encoding of only the three special characters required by the HEOS CLI Protocol Specification: &, =, and %
  • Added comprehensive test coverage for the new encoding behavior
  • Added debug logging for telnet commands

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
HeosCommands.java Replaced URL encoding with selective encoding of only &, =, and % characters as per HEOS specification
HeosCommandsTest.java Added parameterized tests to verify correct encoding behavior for various password scenarios
Telnet.java Added trace logging for sent commands to aid debugging

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM.

Resolves openhab#13445

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@jlaur jlaur force-pushed the 13445-heos-invalid-credentials branch from 855fbe2 to c3b39b1 Compare October 11, 2025 12:55
@lsiepel lsiepel merged commit 20a6a30 into openhab:main Oct 11, 2025
2 checks passed
@lsiepel lsiepel added this to the 5.1 milestone Oct 11, 2025
@lsiepel
Copy link
Contributor

lsiepel commented Oct 11, 2025

Feel free to backport if needed.

@jlaur jlaur deleted the 13445-heos-invalid-credentials branch October 11, 2025 18:45
jlaur added a commit that referenced this pull request Oct 11, 2025
Resolves #13445

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@jlaur jlaur added the backported A PR that has been cherry-picked to a patch release branch label Oct 11, 2025
jlaur added a commit that referenced this pull request Oct 11, 2025
Resolves #13445

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@jlaur jlaur added the backported4 Backported patches to the 4.x branch. Used for constructing release notes. label Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backported A PR that has been cherry-picked to a patch release branch backported4 Backported patches to the 4.x branch. Used for constructing release notes. bug An unexpected problem or unintended behavior of an add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[heos] Login does not work due to incorrect credential handling

3 participants